<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>Allocator Exception Data</title>
    <script type="text/javascript">
		var path = "<%=basePath%>";
		//分配表数据的上传任务批次
		var concentratorNo = "<s:property escape='false' value='concentratorNo' />";
		var recordTime = "<s:date name='recordTime' format='yyyy-MM-dd' nice='false' />";
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<link rel="stylesheet" type="text/css" href="<%=basePath%>beshs/css/content.css" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>resources/datepicker/datepicker.js"></script>
	<!-- 页面特效 -->
	<jsp:include page="/beshs/res-refer/page-effect-reference.jsp" />
	<!-- 系统通用资源 -->
	<jsp:include page="/resources/resource-refer/common-resource-reference.jsp" />
	<!-- 用户访问菜单路径 -->
	<jsp:include page="/resources/usertrace/common-uservisit-reference.jsp" />
  </head>
  <script type="text/javascript">
  function addMeterData() {
		loadNewModal(path+"beshs/assignMeterDataGatherAction!queryMeterDataForManage.do?dataUploadType=batchUpload&concentratorNo="+encodeURIComponent(concentratorNo)+"&recordTime="+recordTime+"&date="+new Date(),"Add distribution table data exception","620px","800px");
	}
	
	function showDetail(meterDataUID) {
		loadNewModal(path+"beshs/assignMeterDataGatherAction!queryMeterDataDetail.do?meterDataUID="+meterDataUID+"&date="+new Date(),"View the distribution table data exception","620px","800px");
	}
	
	function updateMeterData(meterDataUID) {
		loadNewModal(path+"beshs/assignMeterDataGatherAction!queryMeterDataForManage.do?meterDataUID="+meterDataUID+"&dataUploadType=batchUpload&concentratorNo="+encodeURIComponent(concentratorNo)+"&recordTime="+recordTime+"&date="+new Date(),"Modify the distribution table data exception","620px","800px");
	}
  	
  	function deleteMeterData(meterDataUID) {
  		Dialog.confirm("Are you sure to delete this item?", function() {
  			$.getJSON(path+"beshs/assignMeterDataGatherAction!deleteMeterDataByUID.do?date="+new Date(), {
  				meterDataUID: meterDataUID
  	  		}, function(data) {
  	  			if(data.success) {
  	  				Dialog.alert("Successful Operation！", function() {
  	  				window.location = path + "beshs/assignMeterDataGatherAction!queryNonRationalMeterDataList.do?concentratorNo="+encodeURIComponent(concentratorNo)
							+"&recordTime="+recordTime
							+"&date="+new Date();
  	  				});
  	  			} else {
  	  				Dialog.alert("System error, please contact adminitrator！");
  	  			}
  	  		});
  		});
  	}
  	
  	$(function(){
  		$("input[name='query']").click(function(){
  			var seriousNum = $("input[name='seriousNum']").val();
  			var startDate = $("input[name='startDate']").val();
  			var endDate = $("input[name='endDate']").val();
  			window.location = path + "beshs/assignMeterDataGatherAction!queryNonRationalMeterDataList.do?concentratorNo="+encodeURIComponent(concentratorNo)
  					+"&recordTime="+recordTime
  					+"&date="+new Date();
  		});
  		$("input[name='add']").click(function(){
  			addMeterData();
  		});
  	});
  </script>
  <body>
  	<div class="content_all">
	  	<!--查询列表-->
	  	<div class="search_table_all">
	    	<table class="search_table" cellspacing="0" cellpadding="0">
	      		<thead>
	        		<tr>
		          		<th style="width:50px;">Serial No.</th>
			          	<th>Allocator No.</th>
			          	<th>Readings</th>
			          	<th>Rear Board Temperature</th>
			          	<th>Front Board Temperature</th>
			          	<th>Upload Time</th>
			          	<th>Exception State</th>
	        		</tr>
	      		</thead>
	      		<tbody>
	      			<s:iterator value="questionDatas" var="questionData" status="status">
<%-- 	      				<tr style="background-color: <s:property value="#questionData.faultType.color"/>;"> --%>
					<tr>
	      	       			<td><s:property value="#status.index+1" /></td>
		          			<td><s:property value="#questionData.data.seriousNum" /></td>
		          			<td><s:property value="#questionData.data.readNum" /></td>
		          			<td><s:property value="#questionData.data.backTmperature" />&nbsp;&#8451;</td>
		          			<td><s:property value="#questionData.data.fontTemperature" />&nbsp;&#8451;</td>
		          			<td><s:date name="#questionData.data.readTime" format="yyyy-MM-dd HH:mm:ss" nice="false"/></td>
		          			<td><s:property value="#questionData.faultType.name" /></td>
		        	 </tr>
	      			</s:iterator>
	      		</tbody>
	    	</table>
	  	</div>
	</div>
  </body>
</html>
